package com.itheima.tcp;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class SocketDemo01 {
    public static void main(String[] args) throws IOException {
        //TCP客户端
        //1.创建一个socket对象
        Socket socket=new Socket("127.0.0.1",8080);
        //2.获取一个io流写数据
        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("ddd".getBytes());
        //3.释放
        socket.close();
        outputStream.close();
    }
}
